package com.controller.Front;



import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.common.ajax.AjaxRes;
import com.common.mybatis.Page;
import com.controller.base.BaseController;
import com.entity.Users;
import com.service.UsersService;
@Controller
@RequestMapping("/FrontRegistered/")
public class FrontRegisteredController  extends BaseController<Object>{
	//用户
	@Autowired
	private UsersService useService;
	/**
	 * 我的注册状态
	 * @return
	 */
	@RequestMapping("/MyStatus")
	public ModelAndView zcztbank(String state){
		ModelAndView mv=new ModelAndView();
		mv.addObject("state", state);
		mv.setViewName("FrontEnd/zcztbank");
		return mv;
	}
	
	
	
	@RequestMapping("/AllStatus")
	@ResponseBody
	public AjaxRes AllStatus(Users o,Page<Users> page,String state,String is)throws Exception{
		AjaxRes res=new AjaxRes();
		System.out.println("is------------"+is);
		if(is.equals("0")){
			HttpSession session=getRequest().getSession();
			Users user= (Users)session.getAttribute("FrontUser");
			res.setSucceed(user, "数据获取成功");
		}else{
			Page<Users> indPages =useService.findPageByClassID(o, page,state);
			res.setSucceed(indPages, "数据获取成功");
		}
		return res;
	}
}
